home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / stac0193.zip / TEC019.DOC < prev    next >
Text File  |  1991-12-18  |  1KB  |  28 lines

  1.                      Finding SSWAPed drives in C
  2.  
  3.  
  4. If Stacker is installed, using the ST_PTR generated by the call to 
  5. the detect_stacker() function as shown in Appendix B of the Stacker version
  6. 2 manual, it is possible to determine what drives have been swapped using
  7. SSWAP.  At offset 0x52 from ST_PTR is a signature, which consists of the
  8. four characters 'SWAP'.  Following this four byte signature is a 26 byte
  9. array, which contains the original drive numbers (0=A, 1=B, etc) for all
  10. drives.  Each time SSWAP performs a swap of two drives, it interchanges
  11. the corresponding entries in this array.
  12.  
  13. Using C notation, the structure is defined as follows:
  14.  
  15. ST_PTR + 52H --> struct swapmap
  16.                     {
  17.                     char swapSignature[4];    /*  'SWAP' */
  18.                     char swapmap[26];
  19.                     }
  20.  
  21. Note that swapmap[i] (where i=0 means A:, i=1 means B:, etc) contains the
  22. "original" drive number for drive i.   That is, drive i was drive swapmap[i]
  23. at boot time.  To find the inverse function (namely, what is the current
  24. drive number of the drive that was drive j at boot time?), you need to search
  25. the swapmap array to find j.  In other words, if swapmap[k]==j, then drive k
  26. was drive j at boot time.
  27.  
  28.